package com.itheima.controller;

import com.itheima.mapper.UserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserMapper userMapper;


    /*
    如果说当前类中映射注解上没有加映射名称，则本类中只能出现一次
     */
    //全查
    @GetMapping//表示认为当前方法只能通过get请求访问
    public List findAll(){
       return userMapper.findALL();
    }
}
